package com.example.beat_x3.Client;

import java.util.ArrayList;

import Entity.Equipment;
import Entity.Equipments;
import Entity.PlaceSchedule;
import Entity.Places;
import Entity.Rentals;
import Entity.Replys;
import Entity.Reservation;
import Entity.Reservations;
import Entity.Student;

public class GetResult {
    public static Student LoginGR(String account, String password) {
        return (Student) Event.post("login\\"+account+"\\"+password,9998);
    }

    public static int CancelGR(String appointmentNumber){
        return (int) Event.post("cancel\\" + appointmentNumber,9998);
    }

    public static int changeDetailGR(String studentAccount,String musicPreference,int studentSex){
        return (int) Event.post("updateInformation\\"+studentAccount+"\\"+musicPreference+"\\"+studentSex,9998);
    }

    public static int updatePasswordGR(String studentAccount,String oldPassword,String newPassword){
        return (int) Event.post("updatePassword\\"+studentAccount+"\\"+oldPassword+"\\"+newPassword,9998);
    }

    public static int ReturnInstrumentGR(String rentalNumber, String equipmentNumber, String studentAccount, String deadline, int type){
        return (int) Event.post("returnEquipment\\" + equipmentNumber + "\\" + studentAccount + "\\" + type + "\\" + rentalNumber + "\\" + deadline,9998);
    }

    public static int ReserveEquipmentGR(String equipmentNumber,String studentAccount,int span){
        return (int) Event.post("reserveEquipment\\"+equipmentNumber+"\\"+studentAccount+"\\"+span,9998);
    }

    public static int AddNewEquipmentGR(String equipmentName, String studentAccount, String equipmentImage,String span,String detail){
        return (int) Event.post("add\\"+equipmentName+"\\"+studentAccount+"\\"+equipmentImage+"\\"+span+"\\"+detail,9998);
    }

    public static int ChangeStatusGR(String equipmentNumber, int type){
        return (int) Event.post("changeStatus\\" + equipmentNumber + "\\" + type,9998);
    }

    public static int ComplaintGR(String studentAccount, String complaintContent){
        return (int) Event.post("complain\\" + studentAccount + "\\" + complaintContent,9999);
    }

    public static Replys queryReplyGR(String studentAccount){
        return (Replys) Event.post("queryReplys\\" + studentAccount,9999);
    }

    public static int DeleteEquipment(String EquipmentNumber){
        return (int) Event.post("delete\\" + EquipmentNumber,9998);
    }

    public static Equipments QueryEquipments(int type, String StudentAccount){
        return (Equipments) Event.post("queryEquipments\\" + type + "\\" + StudentAccount,9998);
    }

    public static Reservations QueryMyReservation(String studentAccount){
        return (Reservations) Event.post("queryReservations_stu\\"+studentAccount,9998);
    }

    public static Places QueryPlaces(){
        return (Places) Event.post("queryPlaces",9998);
    }

    public static PlaceSchedule QueryPlaceSchedule(String placeNumber){
        return (PlaceSchedule) Event.post("queryPlaceSchedule\\" + placeNumber,9998);
    }

    public static Rentals QueryRentals(String studentAccount, int type){
        return (Rentals) Event.post("queryRentals\\"+studentAccount+"\\"+type,9998);
    }

    public static Reservations QueryReservation(){
        return (Reservations) Event.post("queryReservations_all",9998);
    }

    public static ArrayList<String> QuerySenders(String studentAccount){
        return (ArrayList<String>) Event.post("querySenders\\" + studentAccount,9998);
    }

    public static int Register(String studentAccount,String studentName,int studentSex,String musicPreference,String password){
        return (int) Event.post("register\\"+studentAccount+"\\"+studentName+"\\"+studentSex+"\\"+musicPreference+"\\"+password,9998);
    }

    public static String Reserve(String placeTimeNumber, String studentAccount, String type, String appointTime){
        return (String) Event.post("reserve\\"+placeTimeNumber+"\\"+studentAccount+"\\"+type+"\\"+appointTime,9998);
    }

}
